﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.master" CodeBehind="fastFacts.aspx.cs" Inherits="NCC_SOP.fastFacts" %>



<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2 style="color:red">Fast Stats</h2>
    <h2>&nbsp;&nbsp;&nbsp; Statistics Stratified by Cancer Site</h2>
    
    <fieldset>
        <legend>Searching Criteria:</legend>
        <div style="float: left; width: 100%;">
            <telerik:radgrid id="staticReportList" runat="server" width="100%" datasourceid="SqlDataSource1"
                allowfilteringbycolumn="True" allowsorting="True" allowpaging="True" pagesize="7"
                autogeneratecolumns="False" onprerender="RadGrid1_PreRender" showstatusbar="true"
                enablelinqexpressions="false">

          <MasterTableView DataKeyNames="rptID">
              <Columns>
                  <telerik:GridBoundColumn UniqueName="rptName" DataField="rptName" HeaderText="Report Name"
                      AllowFiltering="false" HeaderStyle-Width="100px" />

                  <telerik:GridBoundColumn UniqueName="cancerSite" DataField="cancerSite" HeaderText="Cancer Site"
                      HeaderStyle-Width="150px">
                      <FilterTemplate>
                          <telerik:RadComboBox ID="RadComboBoxDS" DataSourceID="SqlDataSource2" DataTextField="cancerSite"
                              DataValueField="cancerSite" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("cancerSite").CurrentFilterValue %>'
                              runat="server" OnClientSelectedIndexChanged="DSIndexChanged">
                              <Items>
                                  <telerik:RadComboBoxItem Text="All" />
                              </Items>
                          </telerik:RadComboBox>
                          <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                              <script type="text/javascript">
                                  function DSIndexChanged(sender, args) {
                                      var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                      tableView.filter("cancerSite", args.get_item().get_value(), "EqualTo");
                                  }
                              </script>
                          </telerik:RadScriptBlock>
                      </FilterTemplate>
                  </telerik:GridBoundColumn>


                  <telerik:GridBoundColumn UniqueName="statsType" DataField="statsType" HeaderText="Statistics Type"
                      HeaderStyle-Width="150px">
                      <FilterTemplate>
                          <telerik:RadComboBox ID="RadComboBoxType" DataSourceID="SqlDataSource3" DataTextField="statsType"
                              DataValueField="statsType" Height="200px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("statsType").CurrentFilterValue %>'
                              runat="server" OnClientSelectedIndexChanged="TypeIndexChanged">
                              <Items>
                                  <telerik:RadComboBoxItem Text="All" />
                              </Items>
                          </telerik:RadComboBox>
                          <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                              <script type="text/javascript">
                                  function TypeIndexChanged(sender, args) {
                                      var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                      tableView.filter("statsType", args.get_item().get_value(), "EqualTo");
                                  } 
                              </script>
                          </telerik:RadScriptBlock>
                      </FilterTemplate>
                  </telerik:GridBoundColumn>



                  <telerik:GridBoundColumn UniqueName="rptDescription" DataField="rptDescription" HeaderText="Report Description"
                      AllowFiltering="false" HeaderStyle-Width="200px" />

                  
                  <telerik:GridTemplateColumn 
                    UniqueName="edit" 
                    AllowFiltering="false" 
                    HeaderText="VIEW" HeaderStyle-Width="50px">
                    
                   <ItemTemplate>
                         <%#Eval("isRPT").ToString().Equals("0") ?
                            "<a href='pdfViewer.aspx?rptID=" + Eval("rptID").ToString() + "'><img src='images/file_view.jpg' width='20px' height='20px' alt='' /></a>" :
                            "<a href='" + Eval("fileName").ToString() + "'><img src='images/file_view.jpg' width='20px' height='20px' alt='' /><img src='images/Dynamic_Icon.png' width='20px' height='20px' alt='' /></a>"
                         %>
                    </ItemTemplate>


                </telerik:GridTemplateColumn>


              </Columns>
          </MasterTableView>
      </telerik:radgrid>
        </div>
    </fieldset>


		     <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:localSQLString %>"
            ProviderName="System.Data.SqlClient" 
            SelectCommand="select DISTINCT tableID as rptID, [fileName], tableName as rptName, tableDescription AS rptDescription, cancerSite,  statsType, isRPT from metaDisplay_fastFact"
            ></asp:SqlDataSource>


  <asp:SqlDataSource ID="SqlDataSource2"  runat="server" ConnectionString="<%$ ConnectionStrings:localSQLString %>"
            ProviderName="System.Data.SqlClient" 
            SelectCommand="select distinct cancerSite from metaDisplay_fastFact"

            ></asp:SqlDataSource>

  <asp:SqlDataSource ID="SqlDataSource3"  runat="server" ConnectionString="<%$ ConnectionStrings:localSQLString %>"
            ProviderName="System.Data.SqlClient" 
            SelectCommand="select distinct statsType from metaDisplay_fastFact "
            ></asp:SqlDataSource>



</asp:Content>
